<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="//at.alicdn.com/t/c/font_3981528_jm4q4fbcf5.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            height: 100%;
            background-color: rgb(2, 2, 14);
            transition: all .5s;
        }

        .container {
            min-height: 100%;
            display: flex;
            justify-content: center;
            position: relative;
        }

        .container .background {
            position: absolute;
            top: 0;
            left: 0;
            height: 50vh;
            width: 100%;
            background: url(img/header/background.jpg) no-repeat;
            background-size: 100% 100%;
        }

        .container .content {
            width: 75vw;
            position: absolute;
            top: 35vh;
            display: flex;
        }

        .container .content .left {
            width: 15vw;
            position: absolute;
            transition: all .5s;
        }

        .container .content .left .panel {
            position: relative;
            width: 100%;
            background-color: rgb(33, 63, 100);
            color: #fff;
            box-shadow: 0 5px 15px #000;
            padding: 1vh 0;
        }

        .container .content .left .panel .avatar {
            width: 100%;
            height: 50%;
            background-color: rgb(33, 63, 100);
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .container .content .left .panel .avatar::after {
            content: "";
            border: 1vh solid rgba(0, 0, 0, .0);
            border-top: 10px solid #fff;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, 0);
        }

        .container .content .left .panel .avatar img {
            width: 25%;
            border-radius: 50%;
            box-shadow: 0 5px 10px rgb(19, 36, 57);
        }

        .container .content .left .panel .text {
            display: flex;
            flex-direction: column;
            height: 50%;
            align-items: center;
        }

        .container .content .left .panel .text .name {
            font-size: 2.5vh;
            margin-top: 15px;
            font-weight: 600;
            letter-spacing: 2px;
        }

        .container .content .left .panel .text .signature {
            font-size: 1.8vh;
            color: rgb(184, 194, 205);
            margin-top: 5px;
            border-top: 2px solid #fff;
            padding-top: 5px;
        }

        .container .content .left .navication {
            display: flex;
            flex-direction: column;
            color: #fff;
            width: 100%;
            margin-top: 3vh;
            background-color: rgb(33, 63, 100);
            box-shadow: 0 5px 15px #000;
            padding: 1vh 0;
        }

        .container .content .left .navication>div {
            height: 10vh;
            text-align: center;
            line-height: 10vh;
            transition: all .5s;
            font-size: 2.3vh;
            letter-spacing: 4px;
            cursor: pointer;
            position: relative;
        }

        .container .content .left .navication .arrow {
            content: "";
            border: 10px solid rgba(0, 0, 0, .0);
            border-left: 10px solid #fff;
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            transition: all .5s;
            opacity: 0;
        }

        .container .content .left .navication .iconfont {
            font-size: 3vh;
            margin-right: 1.5vw;
        }

        .container .content .left .navication>div:hover {
            font-size: 2.5vh;
            box-shadow: 5px 5px 5px #000;
        }

        .container .content .right {
            margin-left: 5vw;
            position: absolute;
            left: 15vw;
        }

        .container .content .right .text {
            display: flex;
            flex-direction: column;
            color: #fff;
        }

        .container .content .right .text .hello {
            font-size: 3vh;
            margin-bottom: 2vh;
            text-shadow: 0 0 1px #FFF, 1px 1px 1px #fff, -1px -1px 1px #fff, 0 0 10px #FFF, 0 0 20px rgb(33, 63, 100);
        }

        .container .content .right .text .welcome {
            font-size: 5vh;
            font-weight: 600;
            margin-bottom: 2vh;
            text-shadow: 0 0 1px #FFF, 1px 1px 1px #fff, -1px -1px 1px #fff, 0 0 5px #FFF, 0 0 5px rgb(33, 63, 100);
        }

        .container .content .right .text .brief {
            display: flex;
        }

        .container .content .right .text .brief>div {
            background-color: #fff;
            color: rgb(33, 63, 100);
            padding: 3px 0;
            width: 6vh;
            text-align: center;
            letter-spacing: 3px;
            font-size: 16px;
        }

        .container .content .right .text .brief>p {
            border: 1px solid #fff;
            padding: 2px 8px;
            letter-spacing: 1px;
        }

        .container .content .right .composition {
            color: #fff;
            margin-top: 10vh;
            width: 55vw;
        }

        .container .content .right .composition .shell {
            display: none;
        }

        .container .content .right .composition>div>div {
            width: 55vw;
            position: absolute;
            display: flex;
            /* justify-content: space-around; */
            align-items: space-between;
            flex-wrap: wrap;
            background-color: rgb(2, 2, 14);
        }

        .container .content .right .composition .work .item {
            margin-right: 3.33vw;
            width: 15vw;
            height: 15vh;
            background-color: #fff;
            border-radius: 1vw;
            margin-bottom: 10vh;
            text-align: center;
        }

        .container .content .right .composition .work .item img {
            width: 100%;
            height: 100%;
            border-radius: 1vw;
            margin-bottom: 1vh;
            transition: all .5s;
        }

        .container .content .right .composition .work .item a {
            color: #fff;
            text-decoration: none;
            transition: all .5s;
        }

        .container .content .right .composition .work .item img:hover {
            transform: scale(1.1);
        }

        /* case of style */

        .container .content .right .composition .case {
            display: flex;
            flex-direction: column;
        }

        .container .content .right .composition .case .header {
            display: flex;
            width: 100%;
            margin-bottom: 4vh;
        }

        .container .content .right .composition .case .header p {
            font-size: 18px;
            font-weight: 600;
            letter-spacing: 3px;
        }

        .container .content .right .composition .case .header .dashed {
            border-top: 2px dashed #fff;
            width: calc(100% - 42px - 1vw);
            transform: translateY(50%);
            margin-left: 1vw;
        }

        .container .content .right .composition .case .preitem {
            width: 100%;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: space-between;
            background-color: rgb(2, 2, 14);
        }

        .container .content .right .composition .case .item {
            width: 15vw;
            height: 16vh;
            background-color: #fff;
            border-radius: 1vw;
            margin-bottom: 6vh;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .container .content .right .composition .case .preitem .item img {
            width: 100%;
            height: 100%;
            border-radius: 1vw;
            margin-bottom: 1vh;
            transition: all .5s;
        }

        .container .content .right .composition .case .preitem .item span {
            display: inline-block;
            color: rgb(33, 63, 100);
            position: absolute;
            bottom: -4vh;
            left: 50%;
            transform: translateX(-50%);
            height: 4vh;
            width: 100%;
            line-height: 4vh;
            background-color: rgba(0, 0, 0, .3);
            letter-spacing: 1px;
            transition: all .5s;
            z-index: -1;
        }

        .container .content .right .composition .case .item:hover img {
            transform: scale(1.1);
        }

        .container .content .right .composition .case .item:hover span {
            z-index: 1;
            bottom: 0;
        }

        .container .content .right .composition .case .case-arrow {
            width: 15px;
            height: 15px;
            border: 4px solid #fff;
            border-top: transparent;
            border-left: transparent;
            margin: 0 auto;
            margin-bottom: 3vh;
            transform: rotate(45deg);
            transition: all .5s;
        }

        .container .content .right .composition .case .more-item {
            transition: height .5s;
            width: 100%;
            overflow: hidden;
            text-align: center;
            display: none;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="background"></div>
        <div class="content">
            <div class="left">
                <!-- information panel -->
                <div class="panel">
                    <div class="avatar">
                        <img src="img/home/avatar.jpg" alt="">
                    </div>
                    <div class="text">
                        <p class="name">张予菲</p>
                        <p class="signature">Everything Will Turn Around</p>
                    </div>
                </div>
                <!-- module navication -->
                <div class="navication">
                    <div class="work" style="font-weight: 600;">
                        <div class="arrow" style="left:2vw; opacity: 1;"></div>
                        <i class="iconfont icon-banjizuoye"></i>
                        作业
                    </div>
                    <div class="case">
                        <div class="arrow"></div>
                        <i class="iconfont icon-anli"></i>
                        案例
                    </div>
                    <div class="item">
                        <div class="arrow"></div>
                        <i class="iconfont icon-xiangmu"></i>
                        项目
                    </div>
                    <div class="note">
                        <div class="arrow"></div>
                        <i class="iconfont icon-biji"></i>
                        笔记
                    </div>
                </div>
            </div>
            <div class="right">
                <!-- text of discription my work homepage -->
                <div class="text">
                    <p class="hello">Hello,</p>
                    <p class="welcome">Welcome To The My Works Homepage .</p>
                    <div class="brief">
                        <div>简介</div>
                        <p>客户端软件开发技术课程作业，累计0个。</p>
                    </div>
                </div>
                <!-- composition -->
                <div class="composition">
                    <!-- work -->
                    <div class="shell" style="display:block">
                        <div class="work">
                            <div class="item">
                                <a href="./task/index.html" target="_blank"><img src="./img/task/PrintGraph.png"
                                        alt=""></a>
                                <a href="./task/index.html" target="_blank">01-图形打印</a>
                            </div> 
                            <div class="item">
                                <a href="./task/练习资源包02/task05.html" target="_blank"><img src="./img/task/02.png"
                                        alt=""></a>
                                <a href="./task/练习资源包02/task05.html" target="_blank">02-使用DOM操纵图片</a>
                            </div>
                            <div class="item">
                                <a href="./task/练习资源包03/task3.html" target="_blank"><img src="./img/task/03.png"
                                        alt=""></a>
                                <a href="./task/练习资源包03/task3.html" target="_blank">03-操作坦克移动</a>
                            </div>
                            <div class="item">
                                <a href="./task/作业04/04-实验.html" target="_blank"><img src="./img/task/04.png"
                                        alt=""></a>
                                <a href="./task/作业04/04-实验.html" target="_blank">04-Web网页广告</a>
                            </div>
                            <div class="item">
                                <a href="./task/作业05/index.html" target="_blank"><img src="./img/task/05.png"
                                        alt=""></a>
                                <a href="./task/作业05/index.html" target="_blank">05-使用jQuery修改表格</a>
                            </div>
                            <div class="item">
                                <a href="./task/作业06/index.html" target="_blank"><img src="./img/task/06.png"
                                        alt=""></a>
                                <a href="./task/作业06/index.html" target="_blank">06-使用jQuery制作小游戏</a>
                            </div>
                            <div class="item">
                                <a href="./task/作业07/index.html" target="_blank"><img src="./img/task/07.png"
                                        alt=""></a>
                                <a href="./task/作业07/index.html" target="_blank">06-使用jQuery插件制作demo</a>
                            </div>
                            <div class="item">
                                <a href="./task/作业08/index.html" target="_blank"><img src="./img/task/08.png"
                                        alt=""></a>
                                <a href="./task/作业08/index.html" target="_blank">07-用户注册验证的设计与实现</a>
                            </div>
                            <div class="item">
                                <a href="./task/作业09/index.html" target="_blank"><img src="./img/task/09.png"
                                        alt=""></a>
                                <a href="./task/作业09/index.html" target="_blank">08- 使用ajax实现判断用户名是否存在（使用Node.js编写服务器，需手动开启服务器）</a>
                            </div>
                        </div>
                    </div>
                    <!-- case -->
                    <div class="shell">
                        <div class="case">
                            <!-- layout -->
                            <div class="layout">
                                <div class="header">
                                    <p>布局</p>
                                    <div class="dashed"></div>
                                </div>
                                <div class="preitem">
                                    <div class="item">
                                        <a href="./case/layout/01-index.html" target="_blank">
                                            <img src="./img/case/layout/01.png" alt="">
                                        </a>
                                        <a href="./case/layout/01-index.html" target="_blank"><span>弹性导航栏</span></a>
                                    </div>
                                </div>
                                <div class="case-arrow"></div>
                                <div class="more-item">展开是更多的内容，别急，等有了再加</div>
                            </div>
                            <!-- function -->
                            <div class="function">
                                <div class="header">
                                    <p>功能</p>
                                    <div class="dashed"></div>
                                </div>
                                <div class="preitem">
                                    目前还没有东西，你先别急
                                </div>
                                <div class="case-arrow"></div>
                                <div class="more-item">展开是更多的内容，别急，等有了再加</div>
                            </div>
                            <!-- effect -->
                            <div class="effect">
                                <div class="header">
                                    <p>特效</p>
                                    <div class="dashed"></div>
                                </div>
                                <div class="preitem">
                                    <div class="item">
                                        <a href="./case/effect/01-index.html" target="_blank">
                                            <img src="./img/case/effect/01.png" alt="">
                                        </a>
                                        <a href="./case/effect/01-index.html" target="_blank"><span>按钮悬停效果1</span></a>
                                    </div>
                                    <div class="item">
                                        <a href="./case/effect/02-index.html" target="_blank">
                                            <img src="./img/case/effect/02.png" alt="">
                                        </a>
                                        <a href="./case/effect/02-index.html" target="_blank"><span>按钮悬停效果2</span></a>
                                    </div>
                                </div>
                            </div>
                            <div class="case-arrow"></div>
                            <div class="more-item">展开是更多的内容，别急，等有了再加</div>

                        </div>
                    </div>
                    <!-- project -->
                    <div class="shell">
                        <div class="project">
                            项目-别急，还没来得及写捏
                        </div>
                    </div>
                    <!-- note -->
                    <div class="shell">
                        <div class="note">
                            笔记-别急，还没来得及写捏
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

<script>
    //get element
    let btns = document.querySelectorAll('.navication>div');
    let sections = document.querySelectorAll('.shell');
    let arrows = document.querySelectorAll('.arrow');
    let bar = document.querySelector('.left');
    let brief = document.querySelector('.brief>p');
    let works = document.querySelectorAll('.composition .work>div');
    let cases = document.querySelectorAll('.composition .case .item');
    let projrcts = document.querySelectorAll('.composition .project>div');
    let notes = document.querySelectorAll('.composition .note>div');
    let caseArrows = document.querySelectorAll('.case-arrow');
    let hiddenSections = document.querySelectorAll('.more-item');

    //initilaze data
    function initial() {
        brief.innerHTML = `客户端软件开发技术课程作业，累计${works.length}个。`
    }

    initial();

    //parameters
    let sectionTop = sections[0].offsetTop + 265;
    let barTop = 10;
    let myTimer = -1;
    let birfs = [`重庆工程学院软件学院数字媒体技术专业课程作业，累计${works.length}个`,
        `一些小案例，分为布局、功能、特效三类，累计${cases.length}个`,
        `布局、功能和特效相对完善的小项目，累计${projrcts.length}个`,
        `发表于CSDN上的学习笔记，累计${notes.length}个`
    ]

    //click btns change sections
    for (let i = 0; i < btns.length; i++) {
        btns[i].addEventListener('click', () => {
            //birf change
            brief.innerHTML = birfs[i];
            //all sank
            sections.forEach(item => {
                item.style.display = 'none';
            })
            //this float
            sections[i].style.display = 'block';
            //show arrow
            arrows.forEach(item => {
                item.style.opacity = 0;
                item.style.left = 0;
            })
            arrows[i].style.opacity = 1.0;
            arrows[i].style.left = `2vw`;
            //text change
            btns.forEach(item => {
                item.style.fontWeight = `500`;
            })
            btns[i].style.fontWeight = `600`;
            //window of scroll turn 0
            back();
        })
    }

    //the event of scroll window
    document.addEventListener('scroll', () => {
        //if the section is scrolled by a num , the bar shoud be turn to 'fixed'
        if (window.pageYOffset >= sectionTop) {
            bar.style.position = `fixed`;
            bar.style.top = `${barTop}vh`;
        } else {
            bar.style.position = 'absolute';
            bar.style.top = 0;
        }
    })

    //back window of top
    function back() {
        var scrollTo = document.documentElement.scrollTop || document.body.scrollTop
        if (myTimer == -1) {
            myTimer = setInterval(() => {
                scrollTo -= 60
                if (scrollTo <= 0) {
                    scrollTo = 0
                    window.clearInterval(myTimer)
                    myTimer = -1
                }
                window.scrollTo(0, scrollTo);
            }, 10);
        }
    }

    //click case of arrow, unfold hiddenSections
    for (let i = 0; i < caseArrows.length; i++) {
        //judgment up or down, default true is down
        caseArrows[i].flag = true;
        caseArrows[i].addEventListener('click', () => {
            if (caseArrows[i].flag) {
                caseArrows[i].style.transform = `rotate(${-135}deg)`;
                caseArrows[i].flag = false;
                hiddenSections[i].style.display = 'block';
            } else {
                caseArrows[i].style.transform = `rotate(${45}deg)`;
                caseArrows[i].flag = true;
                hiddenSections[i].style.display = 'none';
            }
        })
    }
</script>

</html>